# 思路：要想请求成功登录接口，需要先拿到验证码接口返回的cookie，然后给登录接口使用即可

# 导包
import requests








# 发送接口请求
# 发送验证码接口
resp_v = requests.get(url="http://127.0.0.1/index.php?m=Home&c=User&a=verify&r=0.6750349409719125")
my_cookie = resp_v.cookies
# 发送登录接口
resp_l = requests.post(url="http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.999687125390627",
              headers={"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},
              data={"username":"13800000000","password":"123456","verify_code":"8888"},
            cookies=my_cookie)

# 查看响应结果
print(resp_l.json())